package com.pagoda.nerp.trade.app.goods.util;

import java.util.Map;

public class ParamValidUtil {

    /**
     * 接口 查询水果分类,查询分类水果信息列表
     * */
    public static String queryCategoryValid(Map<String,Object> params){
        //初始化StringBuffer
        StringBuffer buf = new StringBuffer();
        buf.append("缺失参数:");

        //校验参数categoryId
        if (null == params.get("categoryId")){
            buf.append("categoryId");
        }

        if ( 5 < buf.length()){
            return buf.toString();
        }

        return null;
    }

    /**
     * 接口 查询水果名称
     * */
    public static String queryByGoodsNameValid(Map<String,Object> params){
        //初始化StringBuffer
        StringBuffer buf = new StringBuffer();
        buf.append("缺失参数:");

        //校验参数goodsName
        if (null == params.get("goodsName")){
            buf.append("goodsName");
        }

        if ( 5 < buf.length()){
            return buf.toString();
        }

        return null;
    }

}
